/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author sultan
 */
import java.sql.*;
import javax.swing.*;

public class DataBaseConect {
    static Connection conn =null;
    public static Connection ConnectDb(){
        if(conn!=null){
            return conn;
        }
        try{
        Class.forName("org.sqlite.JDBC");
         conn =DriverManager.getConnection("jdbc:sqlite:poultry.sqlite");
         //conn =DriverManager.getConnection("jdbc:sqlite:D:\\Poutry Farming System\\poultryFarming\\poultry.sqlite");
        //JOptionPane.showConfirmDialog(null, "Connection Established");
        return conn;
           }
        catch(Exception e){
        JOptionPane.showMessageDialog(null, e);
        }
        return null;
    }
}